import type { ModelName } from '../../constants/model-names';

export abstract class BaseModel {
  public abstract readonly name: ModelName;

  public save?(): any;
  public load?(snapshot: any): void;
  public migrate?(old: any): any {
    return old;
  }
  public loadRaw(raw: any): void {
    const latest = this.migrate?.(raw);
    this.load?.(latest);
  }
}
